package com.yl.navigation.ui

import androidx.recyclerview.widget.LinearLayoutManager
import com.yl.common.base.BaseVMFragment
import com.yl.navigation.R
import com.yl.navigation.databinding.FragmentSystemBinding

/**
 * 系统模块
 */
class SystemFragment : BaseVMFragment<FragmentSystemBinding>() {

    private lateinit var lm: LinearLayoutManager

    override fun getLayoutID() = R.layout.fragment_system
    override fun observe() {
    }

    override fun init() {
        lm = LinearLayoutManager(activity)
    }

    fun scrollToTop() {
        mBind.recyclerView.run {
            if (lm.findFirstVisibleItemPosition() > 20) {
                scrollToPosition(0)
            } else {
                smoothScrollToPosition(0)
            }
        }
    }

}